package com.payment.ktb.activity.main4;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.payment.ktb.R;
import com.payment.ktb.activity.BaseActivity;
import com.payment.ktb.application.MyApplication;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by syd on 2016/8/1.
 */
public class BindCardDetailActivity extends BaseActivity {


    @BindView(R.id.tv_bindcarddetail_title)
    TextView tv_bindcarddetail_title;
    @BindView(R.id.tv_bindcarddetail_time)
    TextView tv_bindcarddetail_time;
    @BindView(R.id.tv_bindcarddetail_bankName)
    TextView tv_bindcarddetail_bankName;
    @BindView(R.id.tv_bindcarddetail_bankNo)
    TextView tv_bindcarddetail_bankNo;
    @BindView(R.id.tv_bindcarddetail_status)
    TextView tv_bindcarddetail_status;
    @BindView(R.id.tv_bindcarddetail_memo)
    TextView tv_bindcarddetail_memo;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bindcarddetail);
        ButterKnife.bind(this);
        initTitle("绑卡详情");
        initView();
    }


    private void initView() {

        tv_bindcarddetail_time.setText(getIntent().getStringExtra("time"));
        tv_bindcarddetail_bankName.setText(getIntent().getStringExtra("bankName"));
        tv_bindcarddetail_bankNo.setText(getIntent().getStringExtra("bankNo"));




        String status = getIntent().getStringExtra("status");
        /**
         * INIT(0,"初始化").
         WAIT(1,"等待处理");
         SUCC(2,"处理成功");
         FAIL(3,"处理失败");
         HOLD(9,"保留");
         */
        if ("0".equals(status)) {
            status ="初始化";
        } else if ("1".equals(status)) {
            status ="等待处理";
        } else if ("2".equals(status)) {
            status ="处理成功";
            tv_bindcarddetail_title.setTextColor(MyApplication.getContext().getResources().getColor(R.color.green));

        } else if ("3".equals(status)) {
            status ="处理失败";
            tv_bindcarddetail_title.setTextColor(MyApplication.getContext().getResources().getColor(R.color.red));
            tv_bindcarddetail_memo.setTextColor(MyApplication.getContext().getResources().getColor(R.color.red));

        } else if ("9".equals(status)) {
            status ="保留";
        } else {
            status ="其它";
        }




        tv_bindcarddetail_status.setText(status);
        tv_bindcarddetail_memo.setText(getIntent().getStringExtra("memo"));
    }


    @OnClick(R.id.btn_bindcarddetail_confirm)
    public void clickEvent(View view) {

        finish();
    }

}
